package Presentacion;

import Clases.Empleado;
import Clases.Feriado;
import Clases.HoraExtra;
import Clases.HoraExtraId;
import Clases.Pago;
import Clases.Reloj;
import Clases.Tardia;
import Clases.TardiaId;
import Control.ControlEmpleado;
import Control.ControlFeriado;
import Control.ControlPago;
import com.csvreader.CsvReader;
import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.filechooser.FileNameExtensionFilter;

public class Principal extends javax.swing.JFrame {

    private ImageIcon empleado;
    private ImageIcon deduccion;
    private ImageIcon bono;
    private ImageIcon liquidacion;
    private ImageIcon calculo;
    private ImageIcon reporte;
    private ImageIcon aguinaldo;
    private ImageIcon prestamo;
    ArrayList<Reloj> infoReloj = new ArrayList<Reloj>();
    private static Principal instancia = null;
    ControlEmpleado controlE = ControlEmpleado.obtenerInstancia();
    ControlPago controlP = ControlPago.obtenerInstancia();
    ControlFeriado controlF = ControlFeriado.obtenerInstancia();

    public static Principal obtenerInstancia() {
        if (instancia == null) {
            instancia = new Principal();
        }
        return instancia;
    }

    private Principal() {
        initComponents();

        empleado = new ImageIcon(getClass().getResource("/Imagenes/emp.png"));
        btnEmpleados.setIcon(empleado);

        deduccion = new ImageIcon(getClass().getResource("/Imagenes/deduccion.png"));
        btnDeducciones.setIcon(deduccion);

        bono = new ImageIcon(getClass().getResource("/Imagenes/bono.png"));
        btnBonos.setIcon(bono);

        calculo = new ImageIcon(getClass().getResource("/Imagenes/calculo.png"));
        btnCalculos.setIcon(calculo);

        reporte = new ImageIcon(getClass().getResource("/Imagenes/reportes.png"));
        btnReportes.setIcon(reporte);

        liquidacion = new ImageIcon(getClass().getResource("/Imagenes/liquidacion.png"));
        btnLiquidacion.setIcon(liquidacion);

        aguinaldo = new ImageIcon(getClass().getResource("/Imagenes/aguinaldo.png"));
        btnAguinaldo.setIcon(aguinaldo);

        prestamo = new ImageIcon(getClass().getResource("/Imagenes/prestamo.png"));
        btnPrestamo.setIcon(prestamo);

    }

    public void init(String usuario) {
        setTitle("Sistema de Planilla");
        setLocationRelativeTo(null);
        UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());
        SwingUtilities.updateComponentTreeUI(this);
        this.addWindowListener(null);
        try {
            UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());
            SyntheticaLookAndFeel.setWindowsDecorated(false);
            UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel");
            SwingUtilities.updateComponentTreeUI(this);

        } catch (Exception ex) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        this.setVisible(true);
        this.labelUsuario.setText(usuario);
    }

    public void importarInformacionReloj(String ruta) {
        try {
            CsvReader importar = new CsvReader(ruta);
            importar.readHeaders();
            while (importar.readRecord()) {
                String fila = importar.get(0);
                String[] linea = fila.split(";");
                if (linea.length > 0) {
                    Reloj info = new Reloj();
                    for (int i = 0; i < linea.length; i++) {
                        switch (i) {
                            case 0:
                                info.setCodigoEmpleado(Integer.valueOf(linea[i]));
                                break;
                            case 1:
                                info.setNombreEmpleado(linea[i]);
                                break;
                            case 2:
                                SimpleDateFormat formatoDeFecha = new SimpleDateFormat("dd/MM/yyyy");
                                Date fecha = null;
                                try {
                                    fecha = formatoDeFecha.parse(linea[i]);
                                } catch (ParseException ex) {
                                    Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex);
                                }
                                info.setFecha(fecha);
                                break;
                            case 3:
                                info.setLlegada(linea[i]);
                                break;
                            case 4:
                                info.setSalida(linea[i]);
                                break;
                            case 5:
                                info.setHorasExtra(linea[i]);
                                break;
                            case 6:
                                info.setCantHorasTrabajadas(linea[i]);
                                break;

                        }
                    }
                    infoReloj.add(info);
                }
            }
            importar.close();
        } catch (IOException e) {
        }
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar2 = new javax.swing.JMenuBar();
        jMenu5 = new javax.swing.JMenu();
        jMenu6 = new javax.swing.JMenu();
        jMenuItem8 = new javax.swing.JMenuItem();
        jPanel1 = new javax.swing.JPanel();
        btnEmpleados = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        btnDeducciones = new javax.swing.JButton();
        btnBonos = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        btnReportes = new javax.swing.JButton();
        btnLiquidacion = new javax.swing.JButton();
        btnCalculos = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        btnAguinaldo = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabelLogoEben = new javax.swing.JLabel();
        btnPrestamo = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        labelUsuario = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu7 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();

        jMenu5.setText("File");
        jMenuBar2.add(jMenu5);

        jMenu6.setText("Edit");
        jMenuBar2.add(jMenu6);

        jMenuItem8.setText("jMenuItem8");

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(720, 470));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        btnEmpleados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmpleadosActionPerformed(evt);
            }
        });

        jLabel1.setText("Empleados");

        btnDeducciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeduccionesActionPerformed(evt);
            }
        });

        btnBonos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBonosActionPerformed(evt);
            }
        });

        jLabel2.setText("Deducciones");

        jLabel3.setText("Bonos");

        btnReportes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReportesActionPerformed(evt);
            }
        });

        btnLiquidacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLiquidacionActionPerformed(evt);
            }
        });

        btnCalculos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalculosActionPerformed(evt);
            }
        });

        jLabel4.setText("Generar Planilla");

        jLabel5.setText("Ver Reportes");

        jLabel6.setText("Liquidación/Cesantía");

        btnAguinaldo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAguinaldoActionPerformed(evt);
            }
        });

        jLabel7.setText("Aguinaldo");

        jLabelLogoEben.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelLogoEben.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo4.png"))); // NOI18N
        jLabelLogoEben.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelLogoEben, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabelLogoEben, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 11, Short.MAX_VALUE))
        );

        btnPrestamo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrestamoActionPerformed(evt);
            }
        });

        jLabel8.setText("Préstamo");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel2))
                            .addComponent(btnDeducciones, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnEmpleados, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jLabel1)))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnBonos, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addComponent(jLabel3)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel8))
                            .addComponent(btnPrestamo, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(85, 85, 85)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnCalculos, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel4)))
                        .addGap(91, 91, 91)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel5)
                            .addGap(44, 44, 44))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(btnReportes, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(btnAguinaldo, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(btnLiquidacion, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(29, 29, 29)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(19, 19, 19)
                                .addComponent(jLabel7)))
                        .addGap(21, 21, 21))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnAguinaldo, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnEmpleados, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel7))
                        .addGap(13, 13, 13)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnDeducciones, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnReportes, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnBonos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLiquidacion, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCalculos, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPrestamo, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel6)
                    .addComponent(jLabel4)
                    .addComponent(jLabel8))
                .addContainerGap(43, Short.MAX_VALUE))
        );

        labelUsuario.setText("______________");

        jLabel9.setText("Usuario conectado:");

        jMenu1.setText("Opciones");
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
            }
        });

        jMenu3.setText("Usuario");

        jMenuItem5.setText("Crear Usuario");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem5);

        jMenuItem7.setText("Modificar o Eliminar Usuario");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem7);

        jMenu1.add(jMenu3);

        jMenuItem10.setText("Extraer Informacion del reloj");
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem10);

        jMenuItem6.setText("Ver Históricos");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem6);

        jMenuItem1.setText("Salir");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Calendario");

        jMenuItem3.setText("Ver Calendario");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem3);

        jMenuItem2.setText("Ingresar Dias Feriados");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem2);

        jMenuItem4.setText("Gestión de Vacaciones");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem4);

        jMenuBar1.add(jMenu2);

        jMenu7.setText("Ayuda");

        jMenu4.setText("Ayuda");

        jMenuItem9.setText("Manual de Usuario");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem9);

        jMenu7.add(jMenu4);

        jMenuItem12.setText("Acerca de ");
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu7.add(jMenuItem12);

        jMenuBar1.add(jMenu7);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(labelUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelUsuario)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnEmpleadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmpleadosActionPerformed
        Empleados empleados = new Empleados();
        empleados.init("empleado");
    }//GEN-LAST:event_btnEmpleadosActionPerformed

    private void btnDeduccionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeduccionesActionPerformed
        Deducciones d = Deducciones.obtenerInstancia();
        d.init();
    }//GEN-LAST:event_btnDeduccionesActionPerformed

    private void btnBonosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBonosActionPerformed
        ConsultarBonos b = ConsultarBonos.obtenerInstancia();
        b.limpiarVentana();
        b.init();
    }//GEN-LAST:event_btnBonosActionPerformed

    private void btnReportesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReportesActionPerformed
        OpcionesReportes opciones = new OpcionesReportes();
        opciones.init();
    }//GEN-LAST:event_btnReportesActionPerformed

    private void btnLiquidacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLiquidacionActionPerformed
        LiquidacionCesantia liquidacion = LiquidacionCesantia.obtenerInstancia();
        liquidacion.init();
    }//GEN-LAST:event_btnLiquidacionActionPerformed

    private void btnCalculosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalculosActionPerformed
        int info = JOptionPane.showConfirmDialog(null, "¿Ya importó la información del reloj al sistema?");
        if (JOptionPane.OK_OPTION == info) {
            int confirmado = JOptionPane.showConfirmDialog(null, "¿Está seguro que quiere generar la planilla?");
            if (JOptionPane.OK_OPTION == confirmado) {
                if (controlP.generarPlanilla()) {

                    JOptionPane.showMessageDialog(null, "Los cálculos se generaron correctamente", "Mensaje", JOptionPane.INFORMATION_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(null, "Hubo un error al generar la planilla", "Mensaje", JOptionPane.ERROR_MESSAGE);
                }
            }
        } else {
            JOptionPane.showMessageDialog(null, "Recuerde que debe extraer la información del reloj antes de generar la planilla", "Mensaje", JOptionPane.WARNING_MESSAGE);
        }
    }//GEN-LAST:event_btnCalculosActionPerformed

    private void btnAguinaldoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAguinaldoActionPerformed
        ManejoAguinaldo aguinaldo = new ManejoAguinaldo();
        aguinaldo.init();
    }//GEN-LAST:event_btnAguinaldoActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        Calendario c = new Calendario();
        c.init();
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
        JFileChooser fc = new JFileChooser();
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setMultiSelectionEnabled(false);
        FileNameExtensionFilter filter = new FileNameExtensionFilter(null, "csv");
        fc.setFileFilter(filter);
        ArrayList<Date> fechas = controlP.getPago();
        int respuesta = fc.showOpenDialog(this);
        if (respuesta == JFileChooser.APPROVE_OPTION) {
            File archivo = fc.getSelectedFile();
            this.importarInformacionReloj(archivo.getPath());
            if (infoReloj.get(1).getFecha().after(fechas.get(0))  && infoReloj.get(0).getFecha().before(fechas.get(1))) {
                this.contarTardias();
                this.contarHorasExtra();
                this.contarTotalHorasTrabajadas();
                this.contarFeriados();
                JOptionPane.showMessageDialog(null, "La información se importó correctamente", "Mensaje", JOptionPane.INFORMATION_MESSAGE);
            }else{
                 JOptionPane.showMessageDialog(null, "La información no se pudo importar correctamente", "Mensaje", JOptionPane.ERROR_MESSAGE);
           }
        }
    }//GEN-LAST:event_jMenuItem10ActionPerformed
    public void contarFeriados() {
        int codigoEmpleado = infoReloj.get(0).getCodigoEmpleado();
        Empleado empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
        ArrayList<Date> fechas = controlP.getPago();
        boolean guardar = false;
        int totalHorasFeriado = 0;
        ArrayList<Feriado> feriados = controlF.obtenerListaFeriadosQuincenal(new java.sql.Date(fechas.get(0).getTime()), new java.sql.Date(fechas.get(1).getTime()));
        for (int i = 0; i < infoReloj.size(); i++) {
            if (codigoEmpleado == infoReloj.get(i).getCodigoEmpleado()) {
                java.sql.Date fecha = new java.sql.Date(infoReloj.get(i).getFecha().getTime());
                for (int j = 0; j < feriados.size(); j++) {
                    java.sql.Date feriado = new java.sql.Date(feriados.get(j).getFecha().getTime());
                    if (fecha.equals(feriado)) { // si dia era feriado sumar 8 horas
                        totalHorasFeriado += 8 * 60;
                    }
                }

            } else {
                guardar = true;
            }
            if (guardar || infoReloj.size() - 1 == i) {
                double monto = this.calcularMontoFeriados(empleado, totalHorasFeriado);
                java.sql.Date inicio = new java.sql.Date(fechas.get(0).getTime());
                java.sql.Date fin = new java.sql.Date(fechas.get(1).getTime());
                Pago pagoActual = controlP.getPagoActual(empleado.getNumEmpleado(), inicio, fin);
                pagoActual.setFeriados(monto);
                controlP.modificarPago(pagoActual);
                guardar = false;
                totalHorasFeriado = 0;

                if (infoReloj.size() - 1 != i) {
                    totalHorasFeriado = 0;
                    codigoEmpleado = infoReloj.get(i).getCodigoEmpleado();
                    empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
                    i--; //para q vuelva a preg x ese registro q no coincidio 
                }
            }
            // }
            //    }
        }
    }

    public void contarTotalHorasTrabajadas() {
        int codigoEmpleado = infoReloj.get(0).getCodigoEmpleado();
        Empleado empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
        ArrayList<Date> fechas = controlP.getPago();
        int cantTotalDiaria = 0;
        boolean guardar = false;
        int cantTotalQuincenal = 0;
        int cantHorasExtra = 0;
        for (int i = 0; i < infoReloj.size(); i++) {
            if (!infoReloj.get(i).getCantHorasTrabajadas().isEmpty()) {
                if (codigoEmpleado == infoReloj.get(i).getCodigoEmpleado()) { // && infoReloj.size() - 1 != i
                    String[] hora = infoReloj.get(i).getCantHorasTrabajadas().split(":");
                    if (hora[0].equals("0") && (hora[1].equals("01") || hora[1].equals("00"))) {// quiere decir q es sabado y q todo son extras
                        cantHorasExtra = controlE.getCantHorasExtraDiario(empleado.getNumEmpleado(), new java.sql.Date(infoReloj.get(i).getFecha().getTime()));
                        cantTotalQuincenal += cantHorasExtra;//m va sumando minutos
                        cantHorasExtra = 0;
                    } else {
                        if (hora[0].equals("")) {
                            cantTotalDiaria = Integer.valueOf(hora[1]);
                            cantTotalDiaria += controlE.getCantHorasExtraDiario(empleado.getNumEmpleado(), new java.sql.Date(infoReloj.get(i).getFecha().getTime()));

                        } else {
                            cantTotalDiaria = (Integer.valueOf(hora[0]) * 60) + Integer.valueOf(hora[1]);
                            cantTotalDiaria += controlE.getCantHorasExtraDiario(empleado.getNumEmpleado(), new java.sql.Date(infoReloj.get(i).getFecha().getTime()));

                        }
                        cantTotalQuincenal += cantTotalDiaria;
                        cantTotalDiaria = 0;
                    }
                } else {
                    guardar = true;
                }
                if (guardar || infoReloj.size() - 1 == i) {
                    java.sql.Date inicio = new java.sql.Date(fechas.get(0).getTime());
                    java.sql.Date fin = new java.sql.Date(fechas.get(1).getTime());
                    Pago pagoActual = controlP.getPagoActual(empleado.getNumEmpleado(), inicio, fin);
                    pagoActual.setCantHorasTrabajadas(cantTotalQuincenal / 60);// entre 60 para q meta cant d horas total sino meteria minutos
                    controlP.modificarPago(pagoActual);
                    guardar = false;

                    if (infoReloj.size() - 1 != i) {
                        cantTotalDiaria = 0;
                        cantTotalQuincenal = 0;
                        codigoEmpleado = infoReloj.get(i).getCodigoEmpleado();
                        empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
                        i--;
                    }
                }
                //}
            }
        }
    }

    public void contarTardias() {
        int codigoEmpleado = infoReloj.get(0).getCodigoEmpleado();
        Empleado empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
        ArrayList<Date> fechas = controlP.getPago();
        int totalTardias = 0;
        boolean guardar = false;
        for (int i = 0; i < infoReloj.size(); i++) {
            if (!infoReloj.get(i).getLlegada().isEmpty()) {
                if (codigoEmpleado == infoReloj.get(i).getCodigoEmpleado()) {
                    String[] hora = infoReloj.get(i).getLlegada().split(":");//esto suponiendo q todos entran a la misma hora y q todos marcan hora d entrada          
                    int mins = Integer.valueOf(hora[1]);
                    if ("7".equals(hora[0]) && mins >= 5) { // despues de 5 min se empieza a descontar
                        TardiaId id = new TardiaId(infoReloj.get(i).getFecha(), empleado.getNumEmpleado());
                        Tardia tardia = null;
                        if (mins >= 5 && mins < 10) {
                            totalTardias += (Integer.valueOf(hora[1]) - 5) + 30;// 30mins de castigo 
                            tardia = new Tardia(id, empleado, (Integer.valueOf(hora[1]) - 5) + 30, null);
                        } else {
                            totalTardias += (Integer.valueOf(hora[1]) - 5) + 60;// 60mins de castigo 
                            tardia = new Tardia(id, empleado, (Integer.valueOf(hora[1]) - 5) + 60, null);
                        }
                        controlE.agregarTardias(tardia);
                    } else {
                        if (Integer.valueOf(hora[0]) > 7) {
                            int horas = Integer.valueOf(hora[0]);
                            int minutos = Integer.valueOf(hora[1]);
                            totalTardias += ((horas - 7) * 60) + (minutos - 5) + 60;// 60 de castigo 
                            TardiaId id = new TardiaId(infoReloj.get(i).getFecha(), empleado.getNumEmpleado());
                            Tardia tardia = new Tardia(id, empleado, ((horas - 7) * 60) + (minutos - 5) + 60, null);
                            controlE.agregarTardias(tardia);
                        }
                    }
                } else {
                    guardar = true;
                }
                if (guardar || infoReloj.size() - 1 == i) {
                    //agregue total de tardias de ese empleado (en pago), limpie variables , cambie numEmpleaod y siga cn el sig
                    double montoTardias = this.calcularMontoTardiasEmpleado(empleado, totalTardias);//calcular monto a rebajar por esas tardias
                    java.sql.Date inicio = new java.sql.Date(fechas.get(0).getTime());
                    java.sql.Date fin = new java.sql.Date(fechas.get(1).getTime());
                    Pago pagoActual = controlP.getPagoActual(empleado.getNumEmpleado(), inicio, fin);
                    pagoActual.setTardias(montoTardias);
                    double salarioBase2 = pagoActual.getSalarioBase() - montoTardias;// salarioBase2= salarioBase menos ausencias y tardias
                    pagoActual.setSalarioBase2(salarioBase2);
                    controlP.modificarPago(pagoActual);
                    guardar = false;

                    if (infoReloj.size() - 1 != i) {
                        totalTardias = 0;
                        codigoEmpleado = infoReloj.get(i).getCodigoEmpleado();
                        empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
                        i--; //para q vuelva a preg x ese registro q no coincidio 
                    }
                }
                // }
            }
        }
    }

    public void contarHorasExtra() {
        int codigoEmpleado = infoReloj.get(0).getCodigoEmpleado();
        Empleado empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
        ArrayList<Date> fechas = controlP.getPago();
        int totalExtras = 0;
        boolean guardar = false;
        boolean ultimo=false;
        for (int i = 0; i < infoReloj.size(); i++) {
            if (!infoReloj.get(i).getHorasExtra().isEmpty()) {
                if (codigoEmpleado == infoReloj.get(i).getCodigoEmpleado()) { // && infoReloj.size() - 1 != i
                    String[] hora = infoReloj.get(i).getHorasExtra().split(":");
                    int mins = Integer.valueOf(hora[1]);
                    int hExtras = 0;
                    ///////// preguntar q pasa con = 0:00
                    if ("".equals(hora[0])) {
                        hExtras = mins;
                        totalExtras += mins;
                    } else {
                        hExtras = mins + (Integer.valueOf(hora[0]) * 60);
                        totalExtras += mins + (Integer.valueOf(hora[0]) * 60);
                    }
                    HoraExtraId id = new HoraExtraId(empleado.getNumEmpleado(), infoReloj.get(i).getFecha());
                    HoraExtra extras = new HoraExtra(id, empleado, hExtras);
                    controlE.agregarHorasExtra(extras);
                    ultimo=true;
                } else {
                    guardar = true;
                }
                if (guardar || infoReloj.size() - 1 == i) {
                    double montoExtras = this.calcularMontoHorasExtra(empleado, totalExtras);//calcular monto sumar por esas extras
                    java.sql.Date inicio = new java.sql.Date(fechas.get(0).getTime());
                    java.sql.Date fin = new java.sql.Date(fechas.get(1).getTime());
                    Pago pagoActual = controlP.getPagoActual(empleado.getNumEmpleado(), inicio, fin);
                    pagoActual.setExtras(montoExtras);
                    controlP.modificarPago(pagoActual);
                    guardar = false;

                    if (infoReloj.size() - 1 != i) {
                        totalExtras = 0;
                        codigoEmpleado = infoReloj.get(i).getCodigoEmpleado();
                        empleado = controlE.getEmpleadoCodigo(codigoEmpleado);
                        i--; //para q vuelva a preg x ese registro q no coincidio 
                        ultimo=false;
                    }
                }
                // }
            }
       }
        if(ultimo == true){
            double montoExtras = this.calcularMontoHorasExtra(empleado, totalExtras);//calcular monto sumar por esas extras
            java.sql.Date inicio = new java.sql.Date(fechas.get(0).getTime());
            java.sql.Date fin = new java.sql.Date(fechas.get(1).getTime());
            Pago pagoActual = controlP.getPagoActual(empleado.getNumEmpleado(), inicio, fin);
            pagoActual.setExtras(montoExtras);
            controlP.modificarPago(pagoActual);
            guardar = false;
        }

    }

    public double calcularMontoTardiasEmpleado(Empleado empleado, int cantTotalTardias) {
        double total = 0;
        int salarioQuincenal = empleado.getSalario() / 2;
        int montoXHora = salarioQuincenal / 96;// 96 horas deberia trabajar un empelado x quincena
        int montoMinuto = montoXHora / 60;
        total = montoMinuto * cantTotalTardias;
        return total;
    }

    public double calcularMontoFeriados(Empleado empleado, int cantTotalFeriados) {
        double total = 0;
        int salarioQuincenal = empleado.getSalario() / 2;
        int montoXHora = salarioQuincenal / 96;// 96 horas deberia trabajar un empelado x quincena
        int montoMinuto = montoXHora / 60;
        total = montoMinuto * cantTotalFeriados;
        return total;
    }

    public double calcularMontoHorasExtra(Empleado empleado, int cantExtras) {
        double total = 0;
        int salarioQuincenal = empleado.getSalario() / 2;
        int montoXHora = salarioQuincenal / 96;
        total = montoXHora + (montoXHora / 2);// tiempo y medio 
        return total;
    }

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        int confirmado = JOptionPane.showConfirmDialog(null, "¿Está seguro que desea cerrar SIPE?");
        if (JOptionPane.OK_OPTION == confirmado) {
            System.exit(0);
        }
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        AgregarUsuario usuario = AgregarUsuario.obtenerInstancia();
        usuario.init();
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        ConsultarUsuario usuario = ConsultarUsuario.obtenerInstancia();
        usuario.init();
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        FeriadosCalendario.obtenerInstancia().limpiar();
        FeriadosCalendario.obtenerInstancia().init();
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        ManejoVacaciones mv = ManejoVacaciones.obtenerInstancia();
        mv.init();
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
        Informacion info = new Informacion();
        info.init();
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void btnPrestamoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrestamoActionPerformed
        ManejoPrestamos prestamo = ManejoPrestamos.obtenerInstancia();
        prestamo.init();
    }//GEN-LAST:event_btnPrestamoActionPerformed

    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
    }//GEN-LAST:event_jMenu1ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        Empleados historicos = new Empleados();
        historicos.init("historicos");
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        int confirmado = JOptionPane.showConfirmDialog(null, "¿Está seguro que desea cerrar SIPE?");
        if (JOptionPane.OK_OPTION == confirmado) {
            System.exit(0);
        }
    }//GEN-LAST:event_formWindowClosing

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        try {
            File file = new File("ManualdeUsuario.pdf");
            Desktop.getDesktop().open(file);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        JFrame.setDefaultLookAndFeelDecorated(true);
        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAguinaldo;
    private javax.swing.JButton btnBonos;
    private javax.swing.JButton btnCalculos;
    private javax.swing.JButton btnDeducciones;
    private javax.swing.JButton btnEmpleados;
    private javax.swing.JButton btnLiquidacion;
    private javax.swing.JButton btnPrestamo;
    private javax.swing.JButton btnReportes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelLogoEben;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuBar jMenuBar2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel labelUsuario;
    // End of variables declaration//GEN-END:variables
}
